package com.springboot.demo.entity;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.springboot.demo.Main;

import lombok.Data;
import lombok.NonNull;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;

/**
 * 相当于同时使用了@ToString、@EqualsAndHashCode、@Getter、@Setter和@RequiredArgsConstrutor这些注解，对于POJO类十分有用
 * */ 
@Data
// 打印log
@Slf4j
/**
 * 该注释可以自动覆写toString方法,可以加其他参数；
 * 例：(exclude=”id”) 排除id;
 * (callSuper=true, includeFieldNames=true) 调用父类的toString方法，包含所有属性
 * */ 
@ToString(exclude = "id", callSuper = true, includeFieldNames = true)
public class User {
	
	private static Logger log = LoggerFactory.getLogger(User.class);
	
	/*@Setter
	@Getter*/
	private Integer id;
	
	private String userName;
	
	private String passWord;
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassWord() {
		return passWord;
	}

	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}

	public static void main(String[] args) {
		String result = "123";
		log.info("---result--->{}",result);
	}
	
	public void notNullExample(@NonNull String str){
		str.length();
	}
}
